A technique (multi-task) is known that makes application programs appear to the user as if they are executed at the same time by switching and executing the application programs in turn by a central processing unit (CPU). The application program is herein referred to as a process.
A technique (multi-thread) is also known that divides one process into multiple functions so that the CPU executes the functions in parallel by time sharing. The divided functions are herein referred to as threads. In a single-core processor system, the thread execution sequence is fixed when performing the multi-thread.
In a multi-core processor system, threads of multiple processes are present on CPUs when performing the multi-task multi-thread. The execution sequence defined in a given process may vary by the effect of a thread of another process assigned to the same CPU to which a thread of the given process is assigned.
When a multi-thread program (conventional program) running on the single-core processor system is moved to the multi-core processor system, a problem arises in that the order of access to shared data shared by the threads may shift as a result of a shift in the thread execution sequence. This leads to a problem in that the shared data may have incorrect values. Conventionally, to solve the problem that the shared data have incorrect values, the developer embeds synchronous code into existing program code (see, e.g., Japanese Laid-Open Patent Publication No. 2009-69921) to thereby fix the thread execution sequence.
However, the existing program code has a massive scale and therefore, when performing the code embedding and quality assurance, the development cost will increase significantly. Assembler language description at a timing-critical portion may cause another problem in that, if the synchronous code is embedded at the portion, performance degradation consequent to the embedding of the synchronous code will increase with respect to the required performance.